package la.iok.hzsvn.lewin.movie.cloud.entity;

import java.util.Date;
import java.util.Objects;

/**
 * 用户
 */
public class User {
    /**
     * 唯一id,自增长
     */
    private Long id;
    /**
     * 手机号
     */
    private String phoneNumber;
    /**
     * 用户的昵称。可能为空
     */
    private String nickname;
    /**
     * 用户的姓别。可能0-未知；1-男man；2-女woman
     */
    private int gender;
    /**
     * 密码
     */
    private String password;
    /**
     * 所属组织id,用户的当前组织
     */
    private Long orgUnitId;
    /**
     * 注册时间
     */
    private Date registerTime;
    /**
     * 是否已经被禁止。0表示正常状态,1表示已被禁止
     */
    private Integer disabled;
    /**
     * 注册渠道.默认为0，表示官方渠道，比如管理员添加、PAD端注册、开本时扫描开本二维码注册等（将来可能还会扩展），
     * 1表示微信小程序注册，通过在微信小程序中登录微信进行绑定的时候,是一个未注册的用户手机号，此时进行注册，注册渠道就是1
     */
    private Integer regChannel;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Long getOrgUnitId() {
        return orgUnitId;
    }

    public void setOrgUnitId(Long orgUnitId) {
        this.orgUnitId = orgUnitId;
    }

    public Date getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }

    public Integer getDisabled() {
        return disabled;
    }

    public void setDisabled(Integer disabled) {
        this.disabled = disabled;
    }

    public Integer getRegChannel() {
        return regChannel;
    }

    public void setRegChannel(Integer regChannel) {
        this.regChannel = regChannel;
    }

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(id, user.id) && Objects.equals(phoneNumber, user.phoneNumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, phoneNumber);
    }


}
